<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
<script type="text/javascript">
      function detele(sid) {
    	  var  exit=confirm("确定要删除吗")
    	  if(exit==true){
    		  $.post("deteleServlet","sid="+sid,ballck,"json");
    			 function ballck(data) {
    				  if(data.count>0){
    					  alert("删除成功")
    					  location.href="ListServlet";
    				  }else{
    					  alert("删除失败")
    				  }
    			}
    	  }
		
	}
      $(document).ready(
    		  function() {
				$("tr:odd").css("background-color","Orange");
			});
</script>
</head>
<body>
   <table border="1" id ="table1">
		<tr>
			<th colspan="7" align="middle">学员信息列表</th>
		</tr>
		<tr>
			<th>学员编号</th>
			<th>学员姓名</th>
			<th>学员性别</th>
			<th>学员年龄</th>
			<th>家庭住址</th>
			<th>Email</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${requestScope.list }" var="list">
			<tr>
				<td>${list.sid }</td>
				<td><a href="getnameServlet?sname=${list.sname }">${list.sname }</a></td>
				<td>${list.sgender }</td>
				<td>${list.sage }</td>
				<td>${list.saddress }</td>
				<td>${list.semail}</td>
				<td><a href="javascript:detele(${list.sid });">删除</a></td>
			<tr>
		</c:forEach>
	</table>
	<script type="text/javascript">
	<script type="text/javascript">
	$("tr:odd").css("background", "yellow")
	</script>
	</script>
</body>
</html>